<?php

namespace App\Model;

use App\User;
use Illuminate\Database\Eloquent\Model;

/**
 * App\Model\UserInviteOneYuan
 *
 * @property int $id
 * @property string|null $title 标题
 * @property string|null $content 内容
 * @property float $money 金额
 * @property int $user_id 用户id：A
 * @property int $relation_user_id 被邀请用户id：B【A邀请B】
 * @property \Illuminate\Support\Carbon|null $created_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserInviteOneYuan newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserInviteOneYuan newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserInviteOneYuan query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserInviteOneYuan whereContent($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserInviteOneYuan whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserInviteOneYuan whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserInviteOneYuan whereMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserInviteOneYuan whereRelationUserId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserInviteOneYuan whereTitle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserInviteOneYuan whereUserId($value)
 * @mixin \Eloquent
 * @property-read \App\Model\UserBonusCount $bonusCount
 * @property-read \App\User $user
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserInviteOneYuan whereUpdatedAt($value)
 */
class UserInviteOneYuan extends Model
{
    protected $table = "user_invite_one_yuan";

    /**
     * 会员一元拉总表记录
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function bonusCount()
    {
        return $this->belongsTo(UserBonusCount::class, "relation_user_id", "id");
    }

    /**
     * 一元拉新
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
        return $this->belongsTo(User::class, "user_id","id");
    }


}
